package customer

import (
	"counter-help/admin/server/global"
	"counter-help/admin/server/model/customer"
)

type CustomerPhoneLoginService struct{}

// PhoneLogin 手机登陆
func (s *CustomerPhoneLoginService) PhoneLogin(phone string) (*customer.CusUser, error) {
	var user customer.CusUser
	err := global.GVA_DB.Model(&customer.CusUser{}).Where("phone = ?", phone).First(&user).Error
	if err != nil {
		return nil, err
	}
	return &user, nil
}
